package com.wonderplay.warlord.engine;

import com.wonderplay.engine.ResourceHandler;
import com.wonderplay.warlord.R;
import com.wonderplay.warlord.conf.WarLordConf;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class WarLordResourceHandler implements ResourceHandler{

	private Context context;
	
	public WarLordResourceHandler(Context context){
		this.context = context;
		loadFP();
	}
	
	public Bitmap[] block = new Bitmap[WarLordConf.getTypes()];
	public Bitmap bmTop;
	public Bitmap bg;
	public Bitmap cursor1;
	public Bitmap cursor2;
	public Bitmap imgNum01;
	public Bitmap imgScore;

	
	public void loadFP() {
		Resources r = context.getResources();

		bg = BitmapFactory.decodeResource(r, R.drawable.bg);
		bmTop = BitmapFactory.decodeResource(r, R.drawable.top);
		cursor1 = BitmapFactory.decodeResource(r, R.drawable.cursor1);
		cursor2 = BitmapFactory.decodeResource(r, R.drawable.cursor2);
		imgNum01 = BitmapFactory.decodeResource(r, R.drawable.num01);
		imgScore = BitmapFactory.decodeResource(r, R.drawable.imgscore);
		int scoreSpace = imgScore.getWidth();
		
		block[0] = BitmapFactory.decodeResource(r, R.drawable.star0);
		block[1] = BitmapFactory.decodeResource(r, R.drawable.star1);
		block[2] = BitmapFactory.decodeResource(r, R.drawable.star2);
		block[3] = BitmapFactory.decodeResource(r, R.drawable.star3);
		block[4] = BitmapFactory.decodeResource(r, R.drawable.star4);
		block[5] = BitmapFactory.decodeResource(r, R.drawable.star5);
		block[6] = BitmapFactory.decodeResource(r, R.drawable.star6);
		block[7] = BitmapFactory.decodeResource(r, R.drawable.star7);
	}
	
	public int getBlockWidth(){
		return block[0].getWidth();
	}
	
	public int getBlockHeight(){
		return block[0].getHeight();
	}
}
